<Title><![CDATA[<B>Complete Form example</B>]]></Title>
<Description><![CDATA[This form contains a Credit Card validation example. is aware of differences between the US, Canadian, and International forms of phone numbers, State/Province Codes, and Zip/Postal Codes. Radio buttons will toggle.]]></Description>
<SCRIPT LANGUAGE="JSCRIPT"> <![CDATA[
var dst = ActiveDocument.LocalPath + "\\valid.js";
<Description><![CDATA[This form-field will accept only a properly-formed email address.</P><P><I>The minimum acceptable email address is: a@b.cd (note that the top-level suffix must have at least two characters)</I>]]></Description>
ans = Application.MessageBox("Please drop the object inside a FORM element.", 0, "Client-Side Field Validator");
}
}
if (ActiveDocument.LocalPath != "") // First, check if the file is saved
{
buildpath(); //build the path to the external file based on whether or not document is part of open project
prepdrop(); //determine whether or not it is legal to drop the form element at this location, or make it so
}
else
{
ans = Application.NoticeBox("Document must first be saved.", "Save now", null,"Cancel");
if (ans == 1)
{
ActiveDocument.SaveAs();
}
if (ActiveDocument.LocalPath != "") //check again if they did indeed save and name file
{
buildpath();
prepdrop();
}
}
// ]]></SCRIPT>
</Item>
<Item CLASS="TextData" TYPE="TEXT" ID="2">
<Icon STRING="(416) 555-1212"/>
<OnBlur VALUE="checkUSPhone(this)"/>
<FileName SRC="valid.js"/>
<Title><![CDATA[<B><I> North American phone Numbers</I></B>]]></Title>
<Description><![CDATA[This field will accept only a properly-formed North American phone number. It will also reformat any number entered as (123) 456-7890, throwing away any superfluous delimiters or whitespace.</P>]]></Description>
<Description><![CDATA[This field will accept any combination of (only) numbers, hyphens and spaces, with or without a leading "+" sign.</P>]]></Description>
<Description><![CDATA[This field will accept any real date >01/01/100 CE and <12/31/9999 CE in the form MMDDYYYY. It checks for Y2K (it adds 1900 to any year <100) and leap years.</P>]]></Description>
ans = Application.MessageBox("Please drop the object inside a FORM element.", 0, "Client-Side Field Validator");
}
}
if (ActiveDocument.LocalPath != "") // First, check if the file is saved
{
buildpath(); //build the path to the external file based on whether or not document is part of open project
prepdrop(); //determine whether or not it is legal to drop the form element at this location, or make it so
}
else
{
ans = Application.NoticeBox("Document must first be saved.", "Save now", null,"Cancel");
if (ans == 1)
{
ActiveDocument.SaveAs();
}
if (ActiveDocument.LocalPath != "") //check again if they did indeed save and name file
{
buildpath();
prepdrop();
}
}
// ]]></SCRIPT>
</Item>
<Item CLASS="TextData" TYPE="TEXT" ID="5">
<Icon STRING="http://www.hmfx.com"/>
<FileName SRC="valid.js"/>
<OnBlur VALUE="checkURL(this)"/>
<Title><![CDATA[<B><I>Web URL</I></B>]]></Title>
<Description><![CDATA[This field will accept any URL that contains only alphanumeric characters, hyphen, underscore, and period. The TLD suffix must contain at least two characters. It will prepend "http://", if missing.</P>]]></Description>
ans = Application.MessageBox("Please drop the object inside a FORM element.", 0, "Client-Side Field Validator");
}
}
if (ActiveDocument.LocalPath != "") // First, check if the file is saved
{
buildpath(); //build the path to the external file based on whether or not document is part of open project
prepdrop(); //determine whether or not it is legal to drop the form element at this location, or make it so
}
else
{
ans = Application.NoticeBox("Document must first be saved.", "Save now", null,"Cancel");
if (ans == 1)
{
ActiveDocument.SaveAs();
}
if (ActiveDocument.LocalPath != "") //check again if they did indeed save and name file
{
buildpath();
prepdrop();
}
}
// ]]></SCRIPT>
</Item>
<Item CLASS="TextData" TYPE="TEXT" ID="11">
<Icon STRING="M4R 1K8"/>
<FileName SRC="valid.js"/>
<OnBlur VALUE="checkPostalCode(this)"/>
<Title><![CDATA[<B><I>Canadian Postal Code</I></B>]]></Title>
<Description><![CDATA[Accepts a Canadian Postal Code. Checks for proper alternation of numbers and digits; Reformats to uppercase, with a space.]]></Description>
ans = Application.MessageBox("Please drop the object inside a FORM element.", 0, "Client-Side Field Validator");
}
}
if (ActiveDocument.LocalPath != "") // First, check if the file is saved
{
buildpath(); //build the path to the external file based on whether or not document is part of open project
prepdrop(); //determine whether or not it is legal to drop the form element at this location, or make it so
}
else
{
ans = Application.NoticeBox("Document must first be saved.", "Save now", null,"Cancel");
if (ans == 1)
{
ActiveDocument.SaveAs();
}
if (ActiveDocument.LocalPath != "") //check again if they did indeed save and name file
{
buildpath();
prepdrop();
}
}
// ]]></SCRIPT>
</Item>
<Item CLASS="TextData" TYPE="TEXT" ID="14">
<Icon STRING="North American States / Province List"/>
<FileName SRC="valid.js"/>
<OnBlur VALUE=""/>
<Title><![CDATA[<B>Drop Down State/Province List</B>]]></Title>
<Description><![CDATA[This will insert a drop-down list of all US state names and Canadian province names, and pass the standard 2 letter abbreviation to the form script.]]></Description>
ans = Application.MessageBox("Please drop the object inside a FORM element.", 0, "Client-Side Field Validator");
}
}
if (ActiveDocument.LocalPath != "") // First, check if the file is saved
{
buildpath(); //build the path to the external file based on whether or not document is part of open project
prepdrop(); //determine whether or not it is legal to drop the form element at this location, or make it so
}
else
{
ans = Application.NoticeBox("Document must first be saved.", "Save now", null,"Cancel");
if (ans == 1)
{
ActiveDocument.SaveAs();
}
if (ActiveDocument.LocalPath != "") //check again if they did indeed save and name file
{
buildpath();
prepdrop();
}
}
// ]]></SCRIPT>
</Item>
<Item CLASS="TextData" TYPE="TEXT" ID="15">
<Icon STRING="Country Code Dropdown List"/>
<FileName SRC="valid.js"/>
<OnBlur VALUE=""/>
<Title><![CDATA[<B>Drop Down Country List</B>]]></Title>
<Description><![CDATA[This will insert a drop-down list of country names, and pass the standard 2 letter abbreviation to the form script.]]></Description>